<?php
require_once("DButil.php");
// 查所有视频
$sql1="select videoId,courseName,teacherName,videoInfo,videoPath,t2.status  from t_course t1  join t_video t2 on t1.courseId=t2.courseId  join t_teacher t3 on t2.teacherId=t3.teacherId";

// 查课程id
$sqlcourse="select courseId,courseName,status from t_course";
// 查
$sqlteacher="select teacherId,teacherName,username,password,status,roleId from t_teacher";
// $sqlvideoStatus="select distinct status from t_video";

$arr1=query($sql1);
$arrcourse=query($sqlcourse);
$arrteacher=query($sqlteacher);
// $arrvideoStatus=query($sqlvideoStatus);

$result=[
    "main" => $arr1,
    "course" => $arrcourse,
    "teacher" => $arrteacher
    // "video" => $arrvideoStatus
];



header("Content-Type:application/json;charset=utf-8");
echo json_encode($result);

?>